package org.dev.vlp.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
 * 
 * @TableName vlp_vi_word
 */
@TableName(value ="vlp_vi_word")
@Data
public class Word implements Serializable {
    /**
     * 自增id（单词）
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 单词本身
     */
    private String word;

    /**
     * 单词释义中文
     */
    private String translationCh;

    /**
     * 单词释义英文
     */
    private String translationEn;

    /**
     * 分类
     */
    private String tag;

    /**
     * 单词发音链接
     */
    private String pronunciation;

    /**
     * 创建时间
     */
    private Date gmtCreate;

    /**
     * 修改时间
     */
    private Date gmtModified;

    /**
     * 逻辑删除（1表示删除，0表示未删除）
     */
    private Integer isDeleted;

    /**
     * 词性
     */
    private String pos;

    /**
     * 例句
     */
    private String sentence;

    /**
     * 英文例句
     */
    private String senEn;

    /**
     * 中文例句
     */
    private String senCh;

    private int bookId;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Word other = (Word) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getWord() == null ? other.getWord() == null : this.getWord().equals(other.getWord()))
            && (this.getTranslationCh() == null ? other.getTranslationCh() == null : this.getTranslationCh().equals(other.getTranslationCh()))
            && (this.getTranslationEn() == null ? other.getTranslationEn() == null : this.getTranslationEn().equals(other.getTranslationEn()))
            && (this.getTag() == null ? other.getTag() == null : this.getTag().equals(other.getTag()))
            && (this.getPronunciation() == null ? other.getPronunciation() == null : this.getPronunciation().equals(other.getPronunciation()))
            && (this.getGmtCreate() == null ? other.getGmtCreate() == null : this.getGmtCreate().equals(other.getGmtCreate()))
            && (this.getGmtModified() == null ? other.getGmtModified() == null : this.getGmtModified().equals(other.getGmtModified()))
            && (this.getIsDeleted() == null ? other.getIsDeleted() == null : this.getIsDeleted().equals(other.getIsDeleted()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getWord() == null) ? 0 : getWord().hashCode());
        result = prime * result + ((getTranslationCh() == null) ? 0 : getTranslationCh().hashCode());
        result = prime * result + ((getTranslationEn() == null) ? 0 : getTranslationEn().hashCode());
        result = prime * result + ((getTag() == null) ? 0 : getTag().hashCode());
        result = prime * result + ((getPronunciation() == null) ? 0 : getPronunciation().hashCode());
        result = prime * result + ((getGmtCreate() == null) ? 0 : getGmtCreate().hashCode());
        result = prime * result + ((getGmtModified() == null) ? 0 : getGmtModified().hashCode());
        result = prime * result + ((getIsDeleted() == null) ? 0 : getIsDeleted().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", word=").append(word);
        sb.append(", translationCh=").append(translationCh);
        sb.append(", translationEn=").append(translationEn);
        sb.append(", tag=").append(tag);
        sb.append(", pronunciation=").append(pronunciation);
        sb.append(", gmtCreate=").append(gmtCreate);
        sb.append(", gmtModified=").append(gmtModified);
        sb.append(", isDeleted=").append(isDeleted);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}